$input a_position
$output v_skycoord 

#include "../../bgfx/examples/common/common.sh"


void main()
{
	//mat4 rotView = mat4(mat3(u_view));
	mat4 rotView = mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
	for (int i = 0; i < 3; ++i) {
		for (int j = 0; j < 3; ++j) {
			rotView[i][j] = u_view[i][j];
		}
	}

	//mat4 mvpMtx = u_proj * rotView *u_model[0];
	mat4 mvpMtx = mul(u_proj , mul(rotView ,u_model[0]));
	v_skycoord  = a_position;
	gl_Position = mul(mvpMtx, vec4(a_position, 1.0) );
	gl_Position = gl_Position.xyww;
}
